[Repo Assist] test: add direct unit tests for XmlDoc module (+32 tests, 357→389)#422
Merged
sergey-tihon merged 4 commits intoMay 4, 2026
Conversation
Add dedicated unit tests for the XmlDoc helper functions that were previously only exercised indirectly via full-schema compilation tests. New test modules in UtilsTests.fs: - BuildEnumDocTests: null/empty/single/multiple enum values, null node - CombineDescAndEnumTests: all four (null/value) × (None/Some) combinations - BuildXmlDocTests: summary, remarks (present/absent), param tags, returns tag, and XML escaping of & < > in summary and description New integration tests in Schema.XmlDocTests.fs: - <remarks> tag when description differs from summary - No <remarks> when description equals summary - XML escaping for & < > in generated method XmlDoc - Request body description surfaced as <param> tag - 201 Created response description surfaced as <returns> tag Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds direct and integration-level unit tests around the SwaggerProvider.Internal.XmlDoc helper functions so XmlDoc behavior (enum rendering, description+enum merging, summary/remarks/param/returns formatting, and XML escaping) is validated without relying solely on full-schema compilation tests.
Changes:
- Added direct unit tests for
XmlDoc.buildEnumDoc,XmlDoc.combineDescAndEnum, andXmlDoc.buildXmlDoc. - Added integration tests asserting
<remarks>generation/deduplication, XML escaping, request body description →<param>, and 201 response description →<returns>.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/SwaggerProvider.Tests/UtilsTests.fs | Adds direct unit tests for XmlDoc helper functions (enum doc, combining description + enum doc, and XML doc tag builder). |
| tests/SwaggerProvider.Tests/Schema.XmlDocTests.fs | Adds schema-compilation integration tests to verify produced method XmlDoc includes remarks, escaping, request body param docs, and 201 return docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
|
@copilot fix formating and build |
Agent-Logs-Url: https://github.com/fsprojects/SwaggerProvider/sessions/6e8b7eb1-abd8-4374-86c0-0283bc9afae8 Co-authored-by: sergey-tihon <1197905+sergey-tihon@users.noreply.github.com>
Contributor
This was referenced May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
The
XmlDochelper module (XmlDoc.buildEnumDoc,combineDescAndEnum,buildXmlDoc) was exercised only indirectly through full-schema compilation tests. This PR adds 32 new tests that target these pure functions directly, making regressions faster to detect and easier to diagnose.New test modules added to
UtilsTests.fsBuildEnumDocTestsCombineDescAndEnumTestsBuildXmlDocTests&<>New integration tests added to
Schema.XmlDocTests.fs<remarks>tag is generated when operation description differs from summary<remarks>tag when description equals summary (deduplication)&,<,>in summary/description produce&,<,>descriptionfield surfaces as a<param>tag in the method XmlDocdescriptionsurfaces as a<returns>tagTest Status
Build: ✅ 0 errors, 12 pre-existing warnings (all unrelated to these changes)
Tests: ✅ 389 passed, 0 failed, 1 skipped (pre-existing skip) — up from 357
Format: ✅ Fantomas check passes